package com.black.app.domain.req.store.query;

import cn.hutool.core.util.StrUtil;
import com.black.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@ApiModel(value = "AppStoreFreightTemplateQueryReq", description = "APP端-运费模板查询请求对象")
@Getter
@Setter
public class AppStoreFreightTemplateQueryReq extends PageAbstructReq {

    /**
     * 运费模版id
     */
    @ApiModelProperty(value = "运费模版id")
    private Integer templateId;

    /**
     * 首件数量，超过这个数量另收费
     */
    @ApiModelProperty(value = "首件数量，超过这个数量另收费")
    private Integer maxPieceQuantity;

    /**
     * 不超过首件数量的价格
     */
    @ApiModelProperty(value = "不超过首件数量的价格")
    private Integer maxPiecePrice;

    /**
     * 续件数量，每n件另收费
     */
    @ApiModelProperty(value = "续件数量，每n件另收费")
    private Integer successor;

    /**
     * 续费价格
     */
    @ApiModelProperty(value = "续费价格")
    private Integer renew;


    @ApiModelProperty(hidden = true)
    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())) {
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
